<template>
	<view class="">
		<view class="has_pays">
			<view class="hs_pay">
				买家已付款
				<view class="hs_paymsg">您的珠宝正在整装待发</view>
			</view>
		</view>
		<view class="pay_msg">
			<view class="shr">收货人：{{orderInfo.realname}}<text>&nbsp;&nbsp;</text>{{orderInfo.mobile}}</view>
			<view class="sh_addr">收货地址：<text>&nbsp;&nbsp;</text>{{addressData.province_text+addressData.city_text+addressData.zone_text+addressData.address}}</view>
		</view>
		<view class="pay_price">
			<p class="pay_zj">
				总价：<span class="bigprice">
					<font style="font-size:18px">¥</font>{{orderInfo.order_amount}}
				</span>
			</p>
			<view class="order_succ_a">
				<navigator open-type="redirect" class="check_order" :url="'/pages/jewel/agent/order/orderdetail?order_no='+orderInfo.order_no">查看订单</navigator>
			</view>
			<view class="order_succ_a">
				<navigator open-type="redirect" class="check_order" url='/pages/jewel/agent/goods/categorys'>返回分类页</navigator>
			</view>
		</view>
		<view class="m-loading" v-if="bIsShowLoading">
		    <image src="../../../../static/images/loading.gif" mode="widthFix"></image>
		    <text>加载中</text>
		</view>
	</view>
</template>
<script>
	import hl from '@/common/common_zb.js';
	export default {
		data() {
			return {
				orderInfo: [],
				bIsShowLoading: false,
				addressData: []
			}
		},
		onLoad(options) {
			let order_no = options.order_no;
			let that = this;
			if(order_no) {
				this.bIsShowLoading = true;
				new Promise((resolve, reject) => {
					hl.get('pick/order_success', {order_no: order_no}, true, function (res){
						let resdata = res.data;
						that.orderInfo = res.data.data;
						resolve(that.orderInfo.address_id);
					})
				}).then((address_id)=> {
					hl.get('member/address_view',{id: address_id}, true, function(res){
						that.addressData = res.data.data;
						that.bIsShowLoading = false;
					});
				})
				
			}
		}
	}
</script>

<style>
	.has_pays {
		overflow: hidden;
		padding: 20rpx;
		background-color: #bea374;
	}

	.hs_pay {
		color: #fff;
		font-size: 26rpx;
		margin: 15rpx 15rpx 7rpx 15rpx;
	}

	.hs_paymsg {
		color: #fff;
		font-size: 26rpx;
	}

	.pay_msg {
		overflow: hidden;
		padding: 10px;
		background-color: #fff;
		border-bottom: 1px solid #eee;
	}

	.shr {
		color: #666;
		font-size: 26rpx;
	}

	.sh_addr {
		padding: 4px 0;
		color: #777;
		font-size: 28rpx;
	}

	.pay_price {
		overflow: hidden;
		background-color: #fff;
		padding: 10rpx;
	}

	.pay_zj {
		font-size: 26rpx;
		margin: 5rpx 0 15rpx 0;
	}

	.order_succ_a {
		overflow: hidden;
		width: 100%;
		text-align: center;
	}

	.check_order {
		width: 248rpx;
		line-height: 70rpx;
		height: 70rpx;
		border: 1px solid #999;
		display: inline-block;
		text-align: center;
		margin: 0 auto;
		border-radius: 5rpx;
		color: #666;
		font-size: 28rpx;
		margin-right: 20rpx
	}

	.bigprice {
		color: #bea374;
		font-size: 48rpx;
	}

	.order_succ_a {
		overflow: hidden;
		width: 100%;
		text-align: center;
		margin-top: 20rpx;
	}
</style>
